
const plgin = [
  ['@vuepress/back-to-top'],
  ['@vssue/vuepress-plugin-vssue', {
    // 设置 `platform` 而不是 `api`
    "platform": 'gitee',
    // 其他的 Vssue 配置
    "owner": 'SimonaGo',
    "repo": 'zz3d',
    "clientId": 'ebe8f80a9884fba8460ed3dd705174460f4577216302705bed8e23886662653e',
    "clientSecret": '69ab85c4a3486596b51dcc95f57c24cf89fec9de5ed1ca2d926e109741b89c9d',
    "locale": 'zh'
  }],
  [
    '@vuepress/last-updated',
    {
      transformer: (timestamp, lang) => {
        // 不要忘了安装 moment
        const moment = require('moment')
        moment.locale(lang)
        return moment(timestamp).fromNow()
      }
    }
  ],
  [
    'copyright',
    {
      // noCopy: false, // 选中的文字将无法被复制
      // minLength: 1000, // 如果长度超过 100 个字符
      authorName: {
        "en-US": "SimonaGo--lele",
        "zh-CN": "王乐"
      }
    },
  ],
  [
    'vuepress-plugin-medium-zoom',
    {

      delay: 1000,
      options: {
        margin: 24,
        background: '#1f4d7db0',
        scrollOffset: 0,
      },
    },
  ],
  ['reading-progress'],
  [
    '@vuepress/pwa',
    {
      serviceWorker: true,
      updatePopup: {
        '/': {
          message: '内容有更新',
          buttonText: '刷新'
        }
      }
    }
  ]
]
const sidebar = {
  guide: [{
      title: '基础',
      collapsable: false,
      children: [
        '/guide/installation',
        '/guide/introduction',
        '/guide/event'

      ]
    },
    {
      title: '场景',
      collapsable: false,
      children: [
        '/guide/component-viewer',
      ]
    },
    {
      title: '图层管理',
      collapsable: false,
      children: [
        '/guide/component-layer',
        '/guide/Maplotting'
      ]
    },

  ],
  source: [{
      title: '源码分析',
      collapsable: false,
      children: [
        '/source/widget',
        '/source/cesium'
      ]
    },

    {
      title: '打包工具',
      collapsable: false,
      children: [
        '/source/webpack',
        '/source/gulp'
      ]
    },
    {
      title: '第三方库',
      collapsable: false,
      children: [
        '/source/third-part'
      ]
    },
    {
      title: '前端模块化',
      collapsable: false,
      children: [
        '/source/common',
        '/source/newvision',
        '/source/moudleG',
        '/source/ajax'
      ]
    },
    {
      title: '温故知新',
      collapsable: false,
      children: [
        '/source/promise',
        '/source/setAndMap'
      ]
    },
  ],
  manual: [{
      title: '更新日志',
      collapsable: false,
      children: [
        '/manual/10',
        '/manual/11',
        '/manual/12'
      ]
    },
    {
      title: '说点别的',
      collapsable: false,
      children: [
        '/manual/chuxin'
      ]
    },
  ],
  example: [{
    title: 'Cookbook',
    collapsable: false,
    children: [
      '/example/Cookbook',
      '/example/plane',
      '/example/Analysis',
      '/example/Measurement'
    ]
  }],
  contributing: [{
    title: '贡献文档',
    collapsable: false,
    children: [
      '/contributing/writing',
      '/contributing/styls'
    ]
  }
],
};
const nav = [
    {
    text: '文档',
    ariaLabel: '文档菜单',
    items: [{
        text: '教程',
        link: '/guide/introduction'
      }, 
      {
        text: '基础建设',
        link: '/source/'
      },
      {
        text: '编程风格约定',
        link: '/style-guide/'
      },
      {
        text: 'Cookbook',
        link: '/example/Cookbook'
      }
    ]
  },
  {
    text: '日志',
    ariaLabel: '日志菜单',
    items: [{
        text: '更新日志',
        link: '/manual/12'
      },
      {
        text: 'issue',
        link: '/issue/'
      }
    ]
  },
  {
    text: '贡献文档',
    ariaLabel: '贡献文档菜单',
    items: [{
        text: '编写指南',
        link: '/contributing/writing'
      },
      {
        text: '风格指南',
        link: '/contributing/styls'
      }
    ]
  },
  {
    text: '登录',
    link: '/comment/loginForcomment'
  }
]

module.exports = {
  title: '众智文档',
  description: '众智文档',
  // 注入到当前页面的 HTML <head> 中的标签
  head: [
    [
      'link',
      {
        rel: 'icon',
        href: '/logo.png'
      }
    ],
    ['link', {
      rel: 'manifest',
      href: '/manifest.json'
    }],
    ['meta', {
      name: 'theme-color',
      content: '#3eaf7c'
    }],
    ['meta', {
      name: 'apple-mobile-web-app-capable',
      content: 'yes'
    }],
    ['meta', {
      name: 'viewport',
      content: 'width=device-width, initial-scale=1.0'
    }],
    [
      'meta',
      {
        name: 'apple-mobile-web-app-status-bar-style',
        content: 'black'
      }
    ],
    [
      'link',
      {
        rel: 'apple-touch-icon',
        href: '/images/icons/apple-icon-152x152.png'
      }
    ],
    [
      'meta',
      {
        name: 'msapplication-TileImage',
        content: '/images/icons/ms-icon-144x144.png'
      }
    ],
    ['meta', {
      name: 'msapplication-TileColor',
      content: '#000000'
    }],
  ],
  themeConfig: {
    logo: '/logo.png',
    nav: nav,
    editLinks: true,
    editLinkText: '在 GitHub 上编辑此页',
    lastUpdated: '最近更新时间',
    docsDir: 'main',
    sidebarDepth: 2,
    sidebar: {
      collapsable: true,
      '/guide/': sidebar.guide,
      '/source/': sidebar.source,
      '/manual/': sidebar.manual,
      '/example/': sidebar.example,
      '/contributing/': sidebar.contributing
    },
    smoothScroll: true,
    topBanner: false
  },
  plugins: plgin,
  markdown: {
    lineNumbers: true,
    /** @param {import('markdown-it')} md */
    extendMarkdown: md => {
      md.options.highlight = require('./markdown/highlight')(
        md.options.highlight
      )
    },
    extractHeaders: ['h1', 'h2']
  }
}
